Handling Errors
In all but its printing component, QuickDraw GX uses a sophisticated, three-level system for reporting diagnostic messages. The execution of a function may result in the generation of an error, a warning, or a notice:
Errors, warnings, and notices are not returned as function results. Instead, they are posted, or stored by QuickDraw GX in locations accessible through function calls. To determine whether, for example, an error has occurred, your application makes a specific call (such as
- Errors represent the most severe problems, and occur when a function is unable to execute.
- Warnings occur when a function has completed but may have provided an incorrect or unexpected result.
- Notices occur when unnecessary or redundant actions have been performed. (Notices are available only in the debugging version of QuickDraw GX; see "Debugging and Non-Debugging Versions" on page 1-39 for more information.)
GXGetGraphicsError
) that returns not only the most recent error but also the first error posted since the last time you calledGXGetGraphicsError
. For information about these function calls, see the debugging chapter of Inside Macintosh: QuickDraw GX Environment and Utilities.You can use the error-handling facilities of QuickDraw GX in the following ways:
Functions within the printing component of QuickDraw GX do not use this system for reporting diagnostics. Instead, most functions place errors directly into the job object involved. Some printing functions return a function result of type
- You can install an error-handling function that QuickDraw GX calls whenever an error, warning, or notice occurs.
- You can post errors, warnings, or notices yourself from your own application's functions.
- You can tell QuickDraw GX to ignore specific warnings or notices. You can create and manipulate a list of warnings and a list of notices to be ignored.
OSErr
, that describes a Macintosh error code. For more information, see the core printing features chapter of Inside Macintosh: QuickDraw GX Printing.